class People:
    name = "小明同学"
    _sex = "男"
    __address = "之地"

    def __init__(self, age):
        self.__age = age

    def walk(self):
        print("I can walk")
        self._jump()
        self.__do_that()

    def _jump(self):
        """
        # 方法前面加一个'_'表示这是一个protected方法，不建议从类的外部访问他
        :return:
        """
        print("I can jump")

    def __do_that(self):
        print("I can do anything")

    @staticmethod
    def static_method_test():
        """
        用@staticmethod Decorators(装饰/注解)，指定方法为静态方法
        :return:
        """
        print("I am a static method")


class Student(People):
    stu_number = 0

    def __init__(self, name, sex, address, age, stu_number):
        self.name = name
        self._sex = sex
        self.__address = address
        super(Student, self).__init__(age)
        self.stu_number = stu_number


people = People(12)
print(dir(people))
print(people._People__age)
print(people._jump)
print(people.walk)

student = Student('张ng', '男', '的是非地方', 26, 100010)
print(dir(student))
print(student.name)
print(student._sex)
print(student._Student__address)
print(student._People__age)
print(student.stu_number)
student.walk()
print('student 是否是 People的实例：', isinstance(student, People))
print('student 是否是 Student的实例', isinstance(student, Student))
print('Student 是否是 People的子类', issubclass(Student, People))
print(student.__str__())
print(student.__repr__())
